<!DOCTYPE html>

<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="pl"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="pl"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="pl"> <![endif]-->

<!--[if gt IE 8]>--> <html class="no-js" lang="pl"> <!--[endif]-->

<head>
<meta charset="UTF-8">


<meta name="viewport" content="width=device-width">

<meta name="description" content="Designa Studio, a HTML5 / CSS3 template.">
<meta name="author" content="Sylvain Lafitte, Web Designer, sylvainlafitte.com">

    <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">

    <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
    <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script src="../../js/jquery.flexslider-min.js"></script> 
    <script src="../../js/scripts.js"></script>


<title>HOME // Designa Studio</title>

<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
	
	
	<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,700' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" href="view/css/style.css">
	
	<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>

<body>
<!-- Prompt IE 7 users to install Chrome Frame -->
<!--[if lt IE 8]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->


<div class="container">

	<header id="navtop">
		<a href="index.html" class="logo fleft">
			<img src="view/img/logo.png" alt="Designa Studio">
		</a>

<nav class="fright">
			<ul>
<li><a href="index.html" class="navactive">Home</a></li>
<li><a href="about.html">About</a></li>
</ul>
<ul>
<li><a href="works.html">Works</a></li>
<li><a href="services.html">Services</a></li>
</ul>
<ul>
<li><a href="blog.html">Blog</a></li>
				<li><a href="contact.html">Contact</a></li>
			</ul>
</nav>
</header>



<!-- HEADER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   otwarty jeszcze jeden div -->
<div class="searcher">
	<form id="keys" class="searcher">
		<input id="autocomplete" type="text" placeholder="Banan, Pomidor, Pstrąg" />
	</form>
		<input id="keys_searcher" type="submit" value="Szukaj" onclick="myFunction()" />
</div>

<script>
 
var data = <?php $key= new Keywords();
			$keywords = $key->getAll();
			echo $keywords; 
?>;

function myFunction(){
	var x = document.getElementById('autocomplete').value;
	x = x.toLowerCase();
	
	x = x.replace(/,/g, '');
	x = x.replace(/\s/g, '-'); //spacje
	x = x.replace(/ł/g, 'l');
	x = x.replace(/ż/g, 'z');
	x = x.replace(/ó/g, 'o');
	x = x.replace(/ę/g, 'e');
	x = x.replace(/ś/g, 's');
	x = x.replace(/ń/g, 'n');
	x = x.replace(/ź/g, 'z');
	x = x.replace(/ć/g, 'c');
	x = x.replace(/ą/g, 'a');
	
	window.location = "/"+x;
}


$( "#autocomplete" ).autocomplete({
    source: function( request, response ) {
            var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( request.term ), "i" );
            response( $.grep( data, function( item ){
                return matcher.test( item );
            }) );
        }
	
},{minLength: 2});



</script>

